﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections.ObjectModel;

namespace VoltGameEditor
{
	public partial class CollapsableTexPanel : UserControl
	{
		public int ExpandHeight = 26;
		public int CollapseHeight;
		public bool Expanded = false;

		public CollapsableTexPanel()
		{
			InitializeComponent();
			CollapseHeight = b_collapse.Height;
		}

		private void b_collapse_Click(object sender, EventArgs e)
		{
			if (this.Size.Height == CollapseHeight)
			{
				Expand();
			}
			else
			{
				Collapse();
			}
		}

		public void Collapse()
		{
			b_collapse.Text.Replace("-", "+");
			this.Size = new Size(this.Size.Width, CollapseHeight);
			Expanded = false;
		}
		public void Expand()
		{
			b_collapse.Text.Replace("+", "-");
			this.Size = new Size(this.Size.Width, this.Parent.Height);
			Expanded = true;
		}
	}
	
	public class CTP_Container : FlowLayoutPanel
	{
		Collection<CollapsableTexPanel> _CollapsableTexPanels;
		public Collection<CollapsableTexPanel> CollapsableTexPanels
		{
			get { return _CollapsableTexPanels; }
			set
			{
				_CollapsableTexPanels = value;
			}
		}
	
	}
}
